﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/AdminMasterPage.master" CodeBehind="Edit.aspx.cs"
    Inherits="RMS.Admin.Edit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PagContent" runat="Server">
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true">
        <DataControls>
            <asp:DataControlReference ControlID="FormView1" />
        </DataControls>
    </asp:DynamicDataManager>
    <table class="Details" cellpadding="0" cellspacing="0">
        <tr>
            <td class="header" colspan="2">
                Edit entry from table
                <%= table.DisplayName %>
            </td>
        </tr>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:DynamicValidator runat="server" ID="DetailsViewValidator" ControlToValidate="FormView1"
                    Display="None" CssClass="DDValidator" />
                <asp:FormView runat="server" ID="FormView1" DataSourceID="DetailsDataSource" DefaultMode="Edit"
                    OnItemCommand="FormView1_ItemCommand" OnItemUpdated="FormView1_ItemUpdated" RenderOuterTable="false">
                    <EditItemTemplate>
                        <tr>
                            <td>
                                <asp:DynamicEntity runat="server" Mode="Edit" />
                            </td>
                            <td>
                                <asp:LinkButton runat="server" CommandName="Update" Text="Update" />
                                <asp:LinkButton runat="server" CommandName="Cancel" Text="Cancel" CausesValidation="false" />
                            </td>
                        </tr>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <div class="DDNoItem">
                            No such item.</div>
                    </EmptyDataTemplate>
                </asp:FormView>
                <asp:LinqDataSource ID="DetailsDataSource" runat="server" EnableUpdate="true" />
                <asp:QueryExtender TargetControlID="DetailsDataSource" ID="DetailsQueryExtender"
                    runat="server">
                    <asp:DynamicRouteExpression />
                </asp:QueryExtender>
                <tr>
                    <td colspan="2" class="footer">
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true" />
                    </td>
                </tr>
            </ContentTemplate>
        </asp:UpdatePanel>
    </table>
</asp:Content>
